4.3 Archiving the System Events
You can set up MyID to archive the contents of the system events table in the MyID database periodically in a similar way to archiving the Audit table; see section 4.2, Archiving the audit trail.
You can use the LogEventsArchive table, and a stored procedure, sp_ArchiveLogEvents.
Set up a SQL Timed Task on your MyID database to run the sp_ArchiveLogEvents procedure periodically. The syntax is as follows:
sp_ArchiveLogEvents '<archivedatabase>', <daysOld>
where:
-
<archivedatabase> is the name of the database that will store the archived data.
-
If a single database is being used to store both live and archive information, then the value of <archivedatabase> will be the same as main MyID database. The data will be moved into a separate table.
-
If the archive database name begins with numbers, you must enclose the database name in square brackets. For example:
sp_ArchiveLogEvents '[20100101_CMSArchive]', 90
-
If the archive database exists on a different server, you must configure this as a named "linked server" within SQL Enterprise manager.
The <archivedatabase> would then be specified as:
<LinkedServerName>.<ArchiveDatabaseName>
where:
- <LinkedServerName> is the name of the linked server.
- <ArchiveDatabaseName> is the name of the archive database on that server.
-
-
<daysOld> is the age of data, in days, that will be archived.
For example:
sp_ArchiveLogEvents 'ArchiveDB', 90